<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-number" class="control-label col-xs-12 col-sm-2">{:__('回款编号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-number" data-rule="required" type="text" class="form-control" name="row[number]" value="{$rprefix|htmlentities}"/>
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="number-create" class="btn btn-primary " > {:__('生成')}</button></span>
                    </div>
                </div>


            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('选择客户')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index/selectpage/{$addtype=='add'?'type/all':''}"
                       class="form-control selectpage" name="row[customer_id]" type="text" value="{:htmlentities(isset($contract_r['customer_id'])?$contract_r['customer_id']:input('customer_id'))}">

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group business_id_div ">
            <label for="c-contract_id" class="control-label col-xs-12 col-sm-2">{:__('选择合同')}:</label>
            <div class="col-xs-12 col-sm-8">

                <div class="clickbox">

                    <label class="control-label">
                        <a href="javascript:;" data-url="{$addtype=='add'?'facrm/contract/receivables/selectcontract':'facrm/contract/index/lists/select/1'}" id="select-resources" >
                            {:isset($contract_r['name'])?htmlentities($contract_r['name']):__('选择合同')}</a>
                    </label>
                    <input type="hidden" id="c-contract_id" name="row[contract_id]" id="c-eventkey" class="form-control" value="{:htmlentities(isset($contract_r['id'])?$contract_r['id']:'')}" data-rule="required" readonly/>
                </div>

            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group business_id_div ">
            <label for="c-plan_id" class="control-label col-xs-12 col-sm-2">{:__('回款计划')}:</label>
            <div class="col-xs-12 col-sm-8">

                <div class="clickbox">

                    <label class="control-label">
                        <a href="javascript:;" data-url="facrm/contract/plan/select" id="select-receivable" >

                            {:isset($plan_r['name'])?htmlentities($plan_r['name'])."|应收：".$plan_r['money']."元":__('选择回款计划')}</a>
                    </label>
                    <input type="hidden" id="c-plan_id" name="row[plan_id]" id="c-receivable" class="form-control" value="{:isset($plan_r['id'])?$plan_r['id']:''}" readonly/>
                </div>

            </div>
        </div>



        <div class="col-md-6 col-xs-12 form-group">
            <label for="pay_type" class="control-label col-xs-12 col-sm-2">收款方式:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_radios('row[pay_type]', ['1'=>__('默认方式'), '2'=>__('在线收款')], 1)}
                <span class="text-red">选择在线收款会生成收款码，客户扫码并支付。</span>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('回款金额')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-money" type="number" class="form-control" name="row[money]" value=""/>
            </div>
        </div>

        <div class="pay_type" >
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-customer_id" class="control-label col-xs-12 col-sm-2">{:__('收款帐户')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_select('row[account_id]', $account_list,0, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-return_time" class="control-label col-xs-12 col-sm-2">{:__('回款日期')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-return_time" value="{:datetime(time())}" class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[return_time]" type="text">
            </div>
        </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-flow_admin_id" class="control-label col-xs-12 col-sm-2">{:__('审批人')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:\\app\\admin\\model\\facrm\\Flow::getFlowHtml($flow,$auth->id)}
            </div>
        </div>
        <div id="extend"></div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-remark" class="form-control" name="row[remark]"></textarea>
            </div>
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>






